<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<import type="js" file="js.jquery" />
<import type="js" file="js.common" />
<import type="css" file="css.global" />
</head>
<body>
<div class="list">
<table class="stripe" cellspacing="0">
    <thead>
        <tr>
        	<th style="min-width: 30px;"><input type="checkbox" name="checkid" onclick="if(this.checked==true) { checkAll('key[]'); } else { clearAll('key[]'); }" ></th>
            <th width="10%">用户名</th>
            <th width="12%">姓名</th>
            <th width="11%">部门</th>
            <th width="15%">职务</th>
            <th width="15%">角色</th>
            <th width="10%">在职情况</th>
            <th width="10%">用户状态</th>
            <th width="15%">操作</th>
        </tr>
    </thead>
 
    <tbody>
      <volist name="data" id="vo" empty="$empty">
        <tr>
        	<td><input type="checkbox" name="key[]" value="{$vo.id}"></td>
            <td>{$vo.user_name}</td>
            <td>{$vo.name}</td>
            <td>{$vo.dept_name}</td>
            <td>{$vo.job}</td>
            <td>{$vo.priv_name}</td>
            <td><if condition="$vo['status'] eq 1">在职<else />离职</if></td>
            <td>{$vo.user_status}</td>
            <td><a href="javascript:void(0);" onclick="edit({$vo.id})" title="编辑" >编辑</a>  |  <a href="javascript:void(0);" onclick="del({$vo.id});" title="删除" >删除</a>  |  <a href="javascript:void(0);" onclick="password_email({$vo.id});" title="发送改密邮件" >改密</a></td>
        </tr>
      </volist>
    </tbody>
</table>
</div>
<div class="page">{$page}</div>
</body>
<script language="javascript">
$(document).ready(function(){  
	$(".stripe tr").mouseover(function(){    
	  $(this).addClass("over");}).mouseout(function(){   
			$(this).removeClass("over");}) 
  	$(".stripe tr:even").addClass("alt");
});   
function edit(id){
	window.location="__APP__/User/edit?id="+id+"&dept_id="+{$dept_id};
}
function del(id){
	if(confirm("确定要删除该用户么？删除之后无法恢复！")){
		$.get("__APP__/User/delete?id="+id, function(result){
			location.reload();
		});
	}else{
		return false;
	}
}
function password_email(id){
	$.get("__APP__/User/user_password_email?id="+id, function(result){
		alert(result);
	});
}
</script>  
</html>